12/10/2023
Workflow for sorting and categorizing like songs
Are you someone who just clicks like on a newly discovered song, only to never organize them into playlists on a later date? No? Just me? Darn.
As a chaotic music enjoyer, I often discover new songs on a whim and add it to my liked list on Spotify, which now contains almost 1000 songs. Sometimes my organized friends bug me on how I have to skip through dozens of songs just to find one that matches the vibe. So I set out to create a workflow that could automatically organize my random jumble of sounds into separate playlists each with their own distinct theme.
Smart Curator Component Design
The first step to organizing randomness is to find commonality among the chaos, so I turned to the Spotify Web APIs and discovered readily available audio features that I could use to discern any similarity between songs. I queried the data of all my liked songs and their respective audio features using Spotipy, combined the data streams and stored the dataset as a csv file for analysis.
Given that the nature of the organization is classification, I decided to use K Means Clustering on the dataset after pre-processing it. Using a combination of the Elbow method and the Silhouette Method, 7 ended up being the lucky number for the number of clusters (playlists) to create.
Elbow Method Graph
Silhouette Method Graph
The clustered songs are visually validated visually through a PCA dimensionally reduced graph, where we can see fairly distinct segregation of data based on the color coded clustering. The satisfactory classification is then recorded for each song in order to complete the analysis.
PCA Dimensionally Reduced Graph
Spotify Web API comes in handy once again, where I use the labels to create playlists that are populated with their specific songs. I took note to sort the playlist by their distance to the cluster center, so that if played in order the theme of the song gradually dissipates throughout the listening experience.
Song organizer goes brrr! I achieved automation of playlist making, let me know what you think of this cluster!